package GM.diagram.part;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.View;

import GM.Action;
import GM.AdGoal;
import GM.Agent;
import GM.Attribute;
import GM.ContributionLink;
import GM.Definition;
import GM.Entity;
import GM.Event;
import GM.GMPackage;
import GM.Goal;
import GM.GoalDiagram;
import GM.Mapping;
import GM.Operation;
import GM.Reference;
import GM.RefinementLink;
import GM.State;
import GM.diagram.edit.parts.ActionEditPart;
import GM.diagram.edit.parts.AdGoalActionsEditPart;
import GM.diagram.edit.parts.AdGoalConditionAdGoalCompartmentEditPart;
import GM.diagram.edit.parts.AdGoalEditPart;
import GM.diagram.edit.parts.AdGoalHelpEditPart;
import GM.diagram.edit.parts.AdGoalTriggerAdGoalCompartmentEditPart;
import GM.diagram.edit.parts.AgentEditPart;
import GM.diagram.edit.parts.AgentOperatEditPart;
import GM.diagram.edit.parts.Attribute2EditPart;
import GM.diagram.edit.parts.AttributeEditPart;
import GM.diagram.edit.parts.ContributionLinkEditPart;
import GM.diagram.edit.parts.Definition2EditPart;
import GM.diagram.edit.parts.Definition3EditPart;
import GM.diagram.edit.parts.Definition4EditPart;
import GM.diagram.edit.parts.Definition5EditPart;
import GM.diagram.edit.parts.Definition6EditPart;
import GM.diagram.edit.parts.Definition7EditPart;
import GM.diagram.edit.parts.Definition8EditPart;
import GM.diagram.edit.parts.DefinitionEditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment2EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment3EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment4EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment5EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment6EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment7EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartment8EditPart;
import GM.diagram.edit.parts.DefinitionMappingCompartmentEditPart;
import GM.diagram.edit.parts.EntityAttributeCompartmentEditPart;
import GM.diagram.edit.parts.EntityEditPart;
import GM.diagram.edit.parts.EntityRefCompartEditPart;
import GM.diagram.edit.parts.EntityStateCompartmentEditPart;
import GM.diagram.edit.parts.EventAttrEntityCompartEditPart;
import GM.diagram.edit.parts.EventEditPart;
import GM.diagram.edit.parts.EventParamCompartsEditPart;
import GM.diagram.edit.parts.GoalDiagramEditPart;
import GM.diagram.edit.parts.GoalEditPart;
import GM.diagram.edit.parts.GoalLtlCompartmentEditPart;
import GM.diagram.edit.parts.GoalOperatEditPart;
import GM.diagram.edit.parts.GoalRefEditPart;
import GM.diagram.edit.parts.Mapping2EditPart;
import GM.diagram.edit.parts.Mapping3EditPart;
import GM.diagram.edit.parts.Mapping4EditPart;
import GM.diagram.edit.parts.Mapping5EditPart;
import GM.diagram.edit.parts.Mapping6EditPart;
import GM.diagram.edit.parts.Mapping7EditPart;
import GM.diagram.edit.parts.Mapping8EditPart;
import GM.diagram.edit.parts.MappingEditPart;
import GM.diagram.edit.parts.OperationDompostCompartmentEditPart;
import GM.diagram.edit.parts.OperationDompreCompartmentEditPart;
import GM.diagram.edit.parts.OperationEditPart;
import GM.diagram.edit.parts.OperationReqpostCompartmentEditPart;
import GM.diagram.edit.parts.OperationReqpreCompartmentEditPart;
import GM.diagram.edit.parts.OperationTrigpreCompartmentEditPart;
import GM.diagram.edit.parts.Reference2EditPart;
import GM.diagram.edit.parts.ReferenceEditPart;
import GM.diagram.edit.parts.ReferenceTypeEditPart;
import GM.diagram.edit.parts.RefinementLinkEditPart;
import GM.diagram.edit.parts.RefinementLinkTargetEditPart;
import GM.diagram.edit.parts.StateEditPart;
import GM.diagram.providers.GMElementTypes;

/**
 * @generated
 */
public class GMDiagramUpdater {

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getSemanticChildren(View view) {
		switch (GMVisualIDRegistry.getVisualID(view)) {
		case GoalDiagramEditPart.VISUAL_ID:
			return getGoalDiagram_1000SemanticChildren(view);
		case GoalLtlCompartmentEditPart.VISUAL_ID:
			return getGoalLtlCompartment_7001SemanticChildren(view);
		case DefinitionMappingCompartmentEditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7014SemanticChildren(view);
		case AdGoalTriggerAdGoalCompartmentEditPart.VISUAL_ID:
			return getAdGoalTriggerAdGoalCompartment_7002SemanticChildren(view);
		case AdGoalConditionAdGoalCompartmentEditPart.VISUAL_ID:
			return getAdGoalConditionAdGoalCompartment_7003SemanticChildren(view);
		case DefinitionMappingCompartment3EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7016SemanticChildren(view);
		case DefinitionMappingCompartment4EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7017SemanticChildren(view);
		case OperationDompostCompartmentEditPart.VISUAL_ID:
			return getOperationDompostCompartment_7004SemanticChildren(view);
		case OperationDompreCompartmentEditPart.VISUAL_ID:
			return getOperationDompreCompartment_7005SemanticChildren(view);
		case OperationReqpostCompartmentEditPart.VISUAL_ID:
			return getOperationReqpostCompartment_7006SemanticChildren(view);
		case OperationReqpreCompartmentEditPart.VISUAL_ID:
			return getOperationReqpreCompartment_7007SemanticChildren(view);
		case OperationTrigpreCompartmentEditPart.VISUAL_ID:
			return getOperationTrigpreCompartment_7008SemanticChildren(view);
		case DefinitionMappingCompartment2EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7015SemanticChildren(view);
		case DefinitionMappingCompartment5EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7018SemanticChildren(view);
		case DefinitionMappingCompartment6EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7019SemanticChildren(view);
		case DefinitionMappingCompartment7EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7020SemanticChildren(view);
		case DefinitionMappingCompartment8EditPart.VISUAL_ID:
			return getDefinitionMappingCompartment_7021SemanticChildren(view);
		case EntityStateCompartmentEditPart.VISUAL_ID:
			return getEntityStateCompartment_7009SemanticChildren(view);
		case EntityAttributeCompartmentEditPart.VISUAL_ID:
			return getEntityAttributeCompartment_7010SemanticChildren(view);
		case EntityRefCompartEditPart.VISUAL_ID:
			return getEntityRefCompart_7011SemanticChildren(view);
		case EventAttrEntityCompartEditPart.VISUAL_ID:
			return getEventAttrEntityCompart_7012SemanticChildren(view);
		case EventParamCompartsEditPart.VISUAL_ID:
			return getEventParamComparts_7013SemanticChildren(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getGoalDiagram_1000SemanticChildren(
			View view) {
		if (!view.isSetElement()) {
			return Collections.emptyList();
		}
		GoalDiagram modelElement = (GoalDiagram) view.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getHasGoal().iterator(); it
				.hasNext();) {
			Goal childElement = (Goal) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == GoalEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasAdGoal().iterator(); it
				.hasNext();) {
			AdGoal childElement = (AdGoal) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == AdGoalEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasOper().iterator(); it
				.hasNext();) {
			Operation childElement = (Operation) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == OperationEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasEntity().iterator(); it
				.hasNext();) {
			Entity childElement = (Entity) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == EntityEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasEvent().iterator(); it
				.hasNext();) {
			Event childElement = (Event) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == EventEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasAction().iterator(); it
				.hasNext();) {
			Action childElement = (Action) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == ActionEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasAgent().iterator(); it
				.hasNext();) {
			Agent childElement = (Agent) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == AgentEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		for (Iterator<?> it = modelElement.getHasRLink().iterator(); it
				.hasNext();) {
			RefinementLink childElement = (RefinementLink) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == RefinementLinkEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getGoalLtlCompartment_7001SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Goal modelElement = (Goal) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getDefinition();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == DefinitionEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7014SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == MappingEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getAdGoalTriggerAdGoalCompartment_7002SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		AdGoal modelElement = (AdGoal) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getTrigger();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition3EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getAdGoalConditionAdGoalCompartment_7003SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		AdGoal modelElement = (AdGoal) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getCondition().iterator(); it
				.hasNext();) {
			Definition childElement = (Definition) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition2EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7016SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping2EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7017SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping3EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getOperationDompostCompartment_7004SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Operation modelElement = (Operation) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getDompost();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition4EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getOperationDompreCompartment_7005SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Operation modelElement = (Operation) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getDompre();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition5EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getOperationReqpostCompartment_7006SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Operation modelElement = (Operation) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getReqpost();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition8EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getOperationReqpreCompartment_7007SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Operation modelElement = (Operation) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getReqpre();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition6EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getOperationTrigpreCompartment_7008SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Operation modelElement = (Operation) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		{
			Definition childElement = modelElement.getTrigpre();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Definition7EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7015SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping4EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7018SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping5EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7019SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping6EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7020SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping7EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getDefinitionMappingCompartment_7021SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Definition modelElement = (Definition) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getMappings().iterator(); it
				.hasNext();) {
			Mapping childElement = (Mapping) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Mapping8EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getEntityStateCompartment_7009SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Entity modelElement = (Entity) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getAdmittedStates().iterator(); it
				.hasNext();) {
			State childElement = (State) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == StateEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getEntityAttributeCompartment_7010SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Entity modelElement = (Entity) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getAttributes().iterator(); it
				.hasNext();) {
			Attribute childElement = (Attribute) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == AttributeEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getEntityRefCompart_7011SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Entity modelElement = (Entity) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getReferences().iterator(); it
				.hasNext();) {
			Reference childElement = (Reference) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == ReferenceEditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getEventAttrEntityCompart_7012SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Event modelElement = (Event) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getAttributes().iterator(); it
				.hasNext();) {
			Attribute childElement = (Attribute) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Attribute2EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMNodeDescriptor> getEventParamComparts_7013SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		Event modelElement = (Event) containerView.getElement();
		LinkedList<GMNodeDescriptor> result = new LinkedList<GMNodeDescriptor>();
		for (Iterator<?> it = modelElement.getParameters().iterator(); it
				.hasNext();) {
			Reference childElement = (Reference) it.next();
			int visualID = GMVisualIDRegistry.getNodeVisualID(view,
					childElement);
			if (visualID == Reference2EditPart.VISUAL_ID) {
				result.add(new GMNodeDescriptor(childElement, visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getContainedLinks(View view) {
		switch (GMVisualIDRegistry.getVisualID(view)) {
		case GoalDiagramEditPart.VISUAL_ID:
			return getGoalDiagram_1000ContainedLinks(view);
		case GoalEditPart.VISUAL_ID:
			return getGoal_2001ContainedLinks(view);
		case AdGoalEditPart.VISUAL_ID:
			return getAdGoal_2002ContainedLinks(view);
		case OperationEditPart.VISUAL_ID:
			return getOperation_2003ContainedLinks(view);
		case EntityEditPart.VISUAL_ID:
			return getEntity_2004ContainedLinks(view);
		case EventEditPart.VISUAL_ID:
			return getEvent_2005ContainedLinks(view);
		case ActionEditPart.VISUAL_ID:
			return getAction_2006ContainedLinks(view);
		case AgentEditPart.VISUAL_ID:
			return getAgent_2007ContainedLinks(view);
		case RefinementLinkEditPart.VISUAL_ID:
			return getRefinementLink_2008ContainedLinks(view);
		case DefinitionEditPart.VISUAL_ID:
			return getDefinition_3031ContainedLinks(view);
		case MappingEditPart.VISUAL_ID:
			return getMapping_3044ContainedLinks(view);
		case Definition2EditPart.VISUAL_ID:
			return getDefinition_3032ContainedLinks(view);
		case Mapping2EditPart.VISUAL_ID:
			return getMapping_3045ContainedLinks(view);
		case Definition3EditPart.VISUAL_ID:
			return getDefinition_3033ContainedLinks(view);
		case Mapping3EditPart.VISUAL_ID:
			return getMapping_3046ContainedLinks(view);
		case Definition4EditPart.VISUAL_ID:
			return getDefinition_3034ContainedLinks(view);
		case Mapping4EditPart.VISUAL_ID:
			return getMapping_3047ContainedLinks(view);
		case Definition5EditPart.VISUAL_ID:
			return getDefinition_3035ContainedLinks(view);
		case Mapping5EditPart.VISUAL_ID:
			return getMapping_3048ContainedLinks(view);
		case Definition6EditPart.VISUAL_ID:
			return getDefinition_3036ContainedLinks(view);
		case Mapping6EditPart.VISUAL_ID:
			return getMapping_3049ContainedLinks(view);
		case Definition7EditPart.VISUAL_ID:
			return getDefinition_3037ContainedLinks(view);
		case Mapping7EditPart.VISUAL_ID:
			return getMapping_3050ContainedLinks(view);
		case Definition8EditPart.VISUAL_ID:
			return getDefinition_3038ContainedLinks(view);
		case Mapping8EditPart.VISUAL_ID:
			return getMapping_3051ContainedLinks(view);
		case AttributeEditPart.VISUAL_ID:
			return getAttribute_3039ContainedLinks(view);
		case ReferenceEditPart.VISUAL_ID:
			return getReference_3040ContainedLinks(view);
		case StateEditPart.VISUAL_ID:
			return getState_3041ContainedLinks(view);
		case Attribute2EditPart.VISUAL_ID:
			return getAttribute_3042ContainedLinks(view);
		case Reference2EditPart.VISUAL_ID:
			return getReference_3043ContainedLinks(view);
		case ContributionLinkEditPart.VISUAL_ID:
			return getContributionLink_4007ContainedLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getIncomingLinks(View view) {
		switch (GMVisualIDRegistry.getVisualID(view)) {
		case GoalEditPart.VISUAL_ID:
			return getGoal_2001IncomingLinks(view);
		case AdGoalEditPart.VISUAL_ID:
			return getAdGoal_2002IncomingLinks(view);
		case OperationEditPart.VISUAL_ID:
			return getOperation_2003IncomingLinks(view);
		case EntityEditPart.VISUAL_ID:
			return getEntity_2004IncomingLinks(view);
		case EventEditPart.VISUAL_ID:
			return getEvent_2005IncomingLinks(view);
		case ActionEditPart.VISUAL_ID:
			return getAction_2006IncomingLinks(view);
		case AgentEditPart.VISUAL_ID:
			return getAgent_2007IncomingLinks(view);
		case RefinementLinkEditPart.VISUAL_ID:
			return getRefinementLink_2008IncomingLinks(view);
		case DefinitionEditPart.VISUAL_ID:
			return getDefinition_3031IncomingLinks(view);
		case MappingEditPart.VISUAL_ID:
			return getMapping_3044IncomingLinks(view);
		case Definition2EditPart.VISUAL_ID:
			return getDefinition_3032IncomingLinks(view);
		case Mapping2EditPart.VISUAL_ID:
			return getMapping_3045IncomingLinks(view);
		case Definition3EditPart.VISUAL_ID:
			return getDefinition_3033IncomingLinks(view);
		case Mapping3EditPart.VISUAL_ID:
			return getMapping_3046IncomingLinks(view);
		case Definition4EditPart.VISUAL_ID:
			return getDefinition_3034IncomingLinks(view);
		case Mapping4EditPart.VISUAL_ID:
			return getMapping_3047IncomingLinks(view);
		case Definition5EditPart.VISUAL_ID:
			return getDefinition_3035IncomingLinks(view);
		case Mapping5EditPart.VISUAL_ID:
			return getMapping_3048IncomingLinks(view);
		case Definition6EditPart.VISUAL_ID:
			return getDefinition_3036IncomingLinks(view);
		case Mapping6EditPart.VISUAL_ID:
			return getMapping_3049IncomingLinks(view);
		case Definition7EditPart.VISUAL_ID:
			return getDefinition_3037IncomingLinks(view);
		case Mapping7EditPart.VISUAL_ID:
			return getMapping_3050IncomingLinks(view);
		case Definition8EditPart.VISUAL_ID:
			return getDefinition_3038IncomingLinks(view);
		case Mapping8EditPart.VISUAL_ID:
			return getMapping_3051IncomingLinks(view);
		case AttributeEditPart.VISUAL_ID:
			return getAttribute_3039IncomingLinks(view);
		case ReferenceEditPart.VISUAL_ID:
			return getReference_3040IncomingLinks(view);
		case StateEditPart.VISUAL_ID:
			return getState_3041IncomingLinks(view);
		case Attribute2EditPart.VISUAL_ID:
			return getAttribute_3042IncomingLinks(view);
		case Reference2EditPart.VISUAL_ID:
			return getReference_3043IncomingLinks(view);
		case ContributionLinkEditPart.VISUAL_ID:
			return getContributionLink_4007IncomingLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getOutgoingLinks(View view) {
		switch (GMVisualIDRegistry.getVisualID(view)) {
		case GoalEditPart.VISUAL_ID:
			return getGoal_2001OutgoingLinks(view);
		case AdGoalEditPart.VISUAL_ID:
			return getAdGoal_2002OutgoingLinks(view);
		case OperationEditPart.VISUAL_ID:
			return getOperation_2003OutgoingLinks(view);
		case EntityEditPart.VISUAL_ID:
			return getEntity_2004OutgoingLinks(view);
		case EventEditPart.VISUAL_ID:
			return getEvent_2005OutgoingLinks(view);
		case ActionEditPart.VISUAL_ID:
			return getAction_2006OutgoingLinks(view);
		case AgentEditPart.VISUAL_ID:
			return getAgent_2007OutgoingLinks(view);
		case RefinementLinkEditPart.VISUAL_ID:
			return getRefinementLink_2008OutgoingLinks(view);
		case DefinitionEditPart.VISUAL_ID:
			return getDefinition_3031OutgoingLinks(view);
		case MappingEditPart.VISUAL_ID:
			return getMapping_3044OutgoingLinks(view);
		case Definition2EditPart.VISUAL_ID:
			return getDefinition_3032OutgoingLinks(view);
		case Mapping2EditPart.VISUAL_ID:
			return getMapping_3045OutgoingLinks(view);
		case Definition3EditPart.VISUAL_ID:
			return getDefinition_3033OutgoingLinks(view);
		case Mapping3EditPart.VISUAL_ID:
			return getMapping_3046OutgoingLinks(view);
		case Definition4EditPart.VISUAL_ID:
			return getDefinition_3034OutgoingLinks(view);
		case Mapping4EditPart.VISUAL_ID:
			return getMapping_3047OutgoingLinks(view);
		case Definition5EditPart.VISUAL_ID:
			return getDefinition_3035OutgoingLinks(view);
		case Mapping5EditPart.VISUAL_ID:
			return getMapping_3048OutgoingLinks(view);
		case Definition6EditPart.VISUAL_ID:
			return getDefinition_3036OutgoingLinks(view);
		case Mapping6EditPart.VISUAL_ID:
			return getMapping_3049OutgoingLinks(view);
		case Definition7EditPart.VISUAL_ID:
			return getDefinition_3037OutgoingLinks(view);
		case Mapping7EditPart.VISUAL_ID:
			return getMapping_3050OutgoingLinks(view);
		case Definition8EditPart.VISUAL_ID:
			return getDefinition_3038OutgoingLinks(view);
		case Mapping8EditPart.VISUAL_ID:
			return getMapping_3051OutgoingLinks(view);
		case AttributeEditPart.VISUAL_ID:
			return getAttribute_3039OutgoingLinks(view);
		case ReferenceEditPart.VISUAL_ID:
			return getReference_3040OutgoingLinks(view);
		case StateEditPart.VISUAL_ID:
			return getState_3041OutgoingLinks(view);
		case Attribute2EditPart.VISUAL_ID:
			return getAttribute_3042OutgoingLinks(view);
		case Reference2EditPart.VISUAL_ID:
			return getReference_3043OutgoingLinks(view);
		case ContributionLinkEditPart.VISUAL_ID:
			return getContributionLink_4007OutgoingLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getGoalDiagram_1000ContainedLinks(
			View view) {
		GoalDiagram modelElement = (GoalDiagram) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getContainedTypeModelFacetLinks_ContributionLink_4007(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getGoal_2001ContainedLinks(View view) {
		Goal modelElement = (Goal) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Goal_Ref_4003(modelElement));
		result.addAll(getOutgoingFeatureModelFacetLinks_Goal_Operat_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAdGoal_2002ContainedLinks(View view) {
		AdGoal modelElement = (AdGoal) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_AdGoal_Help_4001(modelElement));
		result.addAll(getOutgoingFeatureModelFacetLinks_AdGoal_Actions_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getOperation_2003ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getEntity_2004ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getEvent_2005ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAction_2006ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAgent_2007ContainedLinks(View view) {
		Agent modelElement = (Agent) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Agent_Operat_4002(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getRefinementLink_2008ContainedLinks(
			View view) {
		RefinementLink modelElement = (RefinementLink) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_RefinementLink_Target_4004(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3031ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3044ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3032ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3045ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3033ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3046ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3034ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3047ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3035ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3048ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3036ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3049ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3037ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3050ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3038ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3051ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAttribute_3039ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getReference_3040ContainedLinks(
			View view) {
		Reference modelElement = (Reference) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Reference_Type_4011(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getState_3041ContainedLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAttribute_3042ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getReference_3043ContainedLinks(
			View view) {
		Reference modelElement = (Reference) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Reference_Type_4011(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getContributionLink_4007ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getGoal_2001IncomingLinks(View view) {
		Goal modelElement = (Goal) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getIncomingFeatureModelFacetLinks_AdGoal_Help_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingFeatureModelFacetLinks_RefinementLink_Target_4004(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_ContributionLink_4007(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAdGoal_2002IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getOperation_2003IncomingLinks(
			View view) {
		Operation modelElement = (Operation) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getIncomingFeatureModelFacetLinks_Agent_Operat_4002(
				modelElement, crossReferences));
		result.addAll(getIncomingFeatureModelFacetLinks_Goal_Operat_4005(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getEntity_2004IncomingLinks(View view) {
		Entity modelElement = (Entity) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getIncomingFeatureModelFacetLinks_Reference_Type_4011(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getEvent_2005IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAction_2006IncomingLinks(View view) {
		Action modelElement = (Action) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getIncomingFeatureModelFacetLinks_AdGoal_Actions_4006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAgent_2007IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getRefinementLink_2008IncomingLinks(
			View view) {
		RefinementLink modelElement = (RefinementLink) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getIncomingFeatureModelFacetLinks_Goal_Ref_4003(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3031IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3044IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3032IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3045IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3033IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3046IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3034IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3047IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3035IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3048IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3036IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3049IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3037IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3050IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3038IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3051IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAttribute_3039IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getReference_3040IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getState_3041IncomingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAttribute_3042IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getReference_3043IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getContributionLink_4007IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getGoal_2001OutgoingLinks(View view) {
		Goal modelElement = (Goal) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Goal_Ref_4003(modelElement));
		result.addAll(getOutgoingFeatureModelFacetLinks_Goal_Operat_4005(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_ContributionLink_4007(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAdGoal_2002OutgoingLinks(View view) {
		AdGoal modelElement = (AdGoal) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_AdGoal_Help_4001(modelElement));
		result.addAll(getOutgoingFeatureModelFacetLinks_AdGoal_Actions_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getOperation_2003OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getEntity_2004OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getEvent_2005OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAction_2006OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAgent_2007OutgoingLinks(View view) {
		Agent modelElement = (Agent) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Agent_Operat_4002(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getRefinementLink_2008OutgoingLinks(
			View view) {
		RefinementLink modelElement = (RefinementLink) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_RefinementLink_Target_4004(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3031OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3044OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3032OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3045OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3033OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3046OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3034OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3047OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3035OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3048OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3036OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3049OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3037OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3050OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getDefinition_3038OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getMapping_3051OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAttribute_3039OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getReference_3040OutgoingLinks(
			View view) {
		Reference modelElement = (Reference) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Reference_Type_4011(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getState_3041OutgoingLinks(View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getAttribute_3042OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getReference_3043OutgoingLinks(
			View view) {
		Reference modelElement = (Reference) view.getElement();
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		result.addAll(getOutgoingFeatureModelFacetLinks_Reference_Type_4011(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<GMLinkDescriptor> getContributionLink_4007OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getContainedTypeModelFacetLinks_ContributionLink_4007(
			GoalDiagram container) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> links = container.getHasCLink().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof ContributionLink) {
				continue;
			}
			ContributionLink link = (ContributionLink) linkObject;
			if (ContributionLinkEditPart.VISUAL_ID != GMVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Goal dst = link.getTarget();
			Goal src = link.getSource();
			result.add(new GMLinkDescriptor(src, dst, link,
					GMElementTypes.ContributionLink_4007,
					ContributionLinkEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_AdGoal_Help_4001(
			Goal target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getAdGoal_Help()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.AdGoalHelp_4001,
						AdGoalHelpEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_Agent_Operat_4002(
			Operation target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getAgent_Operat()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.AgentOperat_4002,
						AgentOperatEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_Goal_Ref_4003(
			RefinementLink target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getGoal_Ref()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.GoalRef_4003, GoalRefEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_RefinementLink_Target_4004(
			Goal target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getRefinementLink_Target()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.RefinementLinkTarget_4004,
						RefinementLinkTargetEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_Goal_Operat_4005(
			Operation target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getGoal_Operat()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.GoalOperat_4005,
						GoalOperatEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_AdGoal_Actions_4006(
			Action target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getAdGoal_Actions()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.AdGoalActions_4006,
						AdGoalActionsEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingTypeModelFacetLinks_ContributionLink_4007(
			Goal target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != GMPackage.eINSTANCE
					.getContributionLink_Target()
					|| false == setting.getEObject() instanceof ContributionLink) {
				continue;
			}
			ContributionLink link = (ContributionLink) setting.getEObject();
			if (ContributionLinkEditPart.VISUAL_ID != GMVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Goal src = link.getSource();
			result.add(new GMLinkDescriptor(src, target, link,
					GMElementTypes.ContributionLink_4007,
					ContributionLinkEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getIncomingFeatureModelFacetLinks_Reference_Type_4011(
			Entity target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() == GMPackage.eINSTANCE
					.getReference_Type()) {
				result.add(new GMLinkDescriptor(setting.getEObject(), target,
						GMElementTypes.ReferenceType_4011,
						ReferenceTypeEditPart.VISUAL_ID));
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_AdGoal_Help_4001(
			AdGoal source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> destinations = source.getHelp().iterator(); destinations
				.hasNext();) {
			Goal destination = (Goal) destinations.next();
			result.add(new GMLinkDescriptor(source, destination,
					GMElementTypes.AdGoalHelp_4001,
					AdGoalHelpEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_Agent_Operat_4002(
			Agent source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> destinations = source.getOperat().iterator(); destinations
				.hasNext();) {
			Operation destination = (Operation) destinations.next();
			result.add(new GMLinkDescriptor(source, destination,
					GMElementTypes.AgentOperat_4002,
					AgentOperatEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_Goal_Ref_4003(
			Goal source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		RefinementLink destination = source.getRef();
		if (destination == null) {
			return result;
		}
		result.add(new GMLinkDescriptor(source, destination,
				GMElementTypes.GoalRef_4003, GoalRefEditPart.VISUAL_ID));
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_RefinementLink_Target_4004(
			RefinementLink source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> destinations = source.getTarget().iterator(); destinations
				.hasNext();) {
			Goal destination = (Goal) destinations.next();
			result.add(new GMLinkDescriptor(source, destination,
					GMElementTypes.RefinementLinkTarget_4004,
					RefinementLinkTargetEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_Goal_Operat_4005(
			Goal source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> destinations = source.getOperat().iterator(); destinations
				.hasNext();) {
			Operation destination = (Operation) destinations.next();
			result.add(new GMLinkDescriptor(source, destination,
					GMElementTypes.GoalOperat_4005,
					GoalOperatEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_AdGoal_Actions_4006(
			AdGoal source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> destinations = source.getActions().iterator(); destinations
				.hasNext();) {
			Action destination = (Action) destinations.next();
			result.add(new GMLinkDescriptor(source, destination,
					GMElementTypes.AdGoalActions_4006,
					AdGoalActionsEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingTypeModelFacetLinks_ContributionLink_4007(
			Goal source) {
		GoalDiagram container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof GoalDiagram) {
				container = (GoalDiagram) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		for (Iterator<?> links = container.getHasCLink().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof ContributionLink) {
				continue;
			}
			ContributionLink link = (ContributionLink) linkObject;
			if (ContributionLinkEditPart.VISUAL_ID != GMVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Goal dst = link.getTarget();
			Goal src = link.getSource();
			if (src != source) {
				continue;
			}
			result.add(new GMLinkDescriptor(src, dst, link,
					GMElementTypes.ContributionLink_4007,
					ContributionLinkEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<GMLinkDescriptor> getOutgoingFeatureModelFacetLinks_Reference_Type_4011(
			Reference source) {
		LinkedList<GMLinkDescriptor> result = new LinkedList<GMLinkDescriptor>();
		Entity destination = source.getType();
		if (destination == null) {
			return result;
		}
		result.add(new GMLinkDescriptor(source, destination,
				GMElementTypes.ReferenceType_4011,
				ReferenceTypeEditPart.VISUAL_ID));
		return result;
	}

}
